﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Lswweb.Domain;
using Lswweb.Model;

namespace Lswweb.Controls
{
    public abstract class ModelHandler : Control
    {
        protected abstract void Handler(int id,SiteModule type);

        protected override void OnLoad(EventArgs e)
        {
            if (Enum.IsDefined(typeof(SiteModule), Type))
                Handler(Id, Type);
        }

        /// <summary>
        /// Id
        /// </summary>
        private int Id
        {
            get
            {
                return SiteContext.Current.Id;
            }
        }

        /// <summary>
        /// 需要删除的类型
        /// </summary>
        private SiteModule Type
        {
            get
            {
                return (SiteModule)SiteContext.Current.Type;
            }
        }
    }
}
